package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Address generated by hbm2java
 */
@Entity
@Table(name = "Address", schema = "dbo", catalog = "imgbms")
public class Address implements java.io.Serializable {

	private Integer id;
	private Country country;
	private String address1;
	private String address2;
	private String zipCode;
	private String city;
	private String localityId;
	private Date lastUpdated;
	private String province;
	private Set<Centre> centres = new HashSet<Centre>(0);
	private Set<Contact> contacts = new HashSet<Contact>(0);
	private Set<NewCentre> newCentres = new HashSet<NewCentre>(0);

	public Address() {
	}

	public Address(Country country, String address1, String address2,
			String zipCode, String city, String localityId, Date lastUpdated,
			String province, Set<Centre> centres, Set<Contact> contacts,
			Set<NewCentre> newCentres) {
		this.country = country;
		this.address1 = address1;
		this.address2 = address2;
		this.zipCode = zipCode;
		this.city = city;
		this.localityId = localityId;
		this.lastUpdated = lastUpdated;
		this.province = province;
		this.centres = centres;
		this.contacts = contacts;
		this.newCentres = newCentres;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "countryId")
	public Country getCountry() {
		return this.country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	@Column(name = "address1", length = 50)
	public String getAddress1() {
		return this.address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	@Column(name = "address2", length = 50)
	public String getAddress2() {
		return this.address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	@Column(name = "zipCode", length = 50)
	public String getZipCode() {
		return this.zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Column(name = "city", length = 50)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "localityId", length = 50)
	public String getLocalityId() {
		return this.localityId;
	}

	public void setLocalityId(String localityId) {
		this.localityId = localityId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastUpdated", length = 23)
	public Date getLastUpdated() {
		return this.lastUpdated;
	}

	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}

	@Column(name = "province", length = 50)
	public String getProvince() {
		return this.province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<Centre> getCentres() {
		return this.centres;
	}

	public void setCentres(Set<Centre> centres) {
		this.centres = centres;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<Contact> getContacts() {
		return this.contacts;
	}

	public void setContacts(Set<Contact> contacts) {
		this.contacts = contacts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "address")
	public Set<NewCentre> getNewCentres() {
		return this.newCentres;
	}

	public void setNewCentres(Set<NewCentre> newCentres) {
		this.newCentres = newCentres;
	}

}
